package com.joolun.mall.service.impl;

import java.util.List;
import com.joolun.common.utils.DateUtils;
import com.joolun.mall.entity.TbWork;
import com.joolun.mall.mapper.TbWorkMapper;
import com.joolun.mall.service.ITbWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * workService业务层处理
 * 
 * @author www.joolun.com
 * @date 2023-02-17
 */
@Service
public class TbWorkServiceImpl implements ITbWorkService
{
    @Autowired
    private TbWorkMapper tbWorkMapper;

    /**
     * 查询work
     * 
     * @param id workID
     * @return work
     */
    @Override
    public TbWork selectTbWorkById(Long id)
    {
        return tbWorkMapper.selectTbWorkById(id);
    }

    /**
     * 查询work列表
     * 
     * @param tbWork work
     * @return work
     */
    @Override
    public List<TbWork> selectTbWorkList(TbWork tbWork)
    {
        return tbWorkMapper.selectTbWorkList(tbWork);
    }

    /**
     * 新增work
     * 
     * @param tbWork work
     * @return 结果
     */
    @Override
    public int insertTbWork(TbWork tbWork)
    {
        tbWork.setCreateTime(DateUtils.getNowDate());
        return tbWorkMapper.insertTbWork(tbWork);
    }

    /**
     * 修改work
     * 
     * @param tbWork work
     * @return 结果
     */
    @Override
    public int updateTbWork(TbWork tbWork)
    {
        return tbWorkMapper.updateTbWork(tbWork);
    }

    /**
     * 批量删除work
     * 
     * @param ids 需要删除的workID
     * @return 结果
     */
    @Override
    public int deleteTbWorkByIds(Long[] ids)
    {
        return tbWorkMapper.deleteTbWorkByIds(ids);
    }

    /**
     * 删除work信息
     * 
     * @param id workID
     * @return 结果
     */
    @Override
    public int deleteTbWorkById(Long id)
    {
        return tbWorkMapper.deleteTbWorkById(id);
    }
}
